home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Frame Negotiation
- Sent: 7/18/96 10:41 AM
- Received: 7/18/96 11:01 AM
- From: Henri Lamiraux, lamiraux@apple.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >Are there any code examples around which demonstrate a part which
- >requests its frame shape, and a container that can process the requests?
- >The majority of the info on frame negotiation seems to be in the OpenDoc
- >docs and the procedure in ODF seems to be significantly different (ie the
- >proxies get involved, the RequestFrameShape() returns boolean instead of
- >ODShape, etc..)
- >
- >Some specific questions that I think are related:
- >
- >What exactly does a part call when it wants to change its shape? If it
- >should call the frames RequestFrameShape, do I override the method or
- >just call it with the shape I want?
- >
-
- Look at ODFBitmap (CBitmapFrame::AdjustFrameSize). When a new image is
- dropped on ODFBitmap it request a new frame shape to display as much as
- possible of the new bitmap. When using ODF the default behavior
- implemented by ODF is for a container to grant the new shape (ODFDraw,
- ODFContainer). So in this case you don't have anything to do. Now if you
- need to do something different you need to override
- FW_MProxy::FrameShapeRequested (see ODFTable and ODFEmbed). For example:
- because ODFTable only supports resizing a cell using the mouse it always
- return the cell size in the override of FrameShapeRequested.
-
- >What are the Used and Active shapes. Do you set one of these, and the
- >rest of the frame negotiation is automatic (assuming you accect what you
- >get)? AdjustActiveShape() and AdjustUsedShape() in FW_CFrame seem to
- >imply that I should do something there, but what? The ODF docs metion
- >that I probably want to override them, but doesn't say why or what to do
- >in the methods.
- >
-
- You need to read the OpenDoc Programmer's Guide. It explains what the
- Used and Active shapes are. ODF implements the default behavior for
- setting the used and active shape. By default, with ODF, the used and
- active shape are set to the frame shape. To change that override
- FW_CFrame::AdjustUsedShape and FW_CFrame::AdjustActiveShape. See the
- ODFClock part for an example.
-
- >
- >If anyone has the time, desire, sympathy etc to help me out, here's what
- >I'm trying to do:
- >I have a container very similar to ODFTable, and the embedded parts need
- >to change their height programatically (ie expand and collapse like
- >folders in the finder). I want the embedded parts to change their
- >height, and the contining table to change the row height to accomodate
- >the new part height. Shifting the other embedded frames should be no
- >problem since ODFTable does this when grid lines are dragged anyway. I
- >need something more than "just call RequestFrameShape()", since I have
- >been unable to uncover any info on how to do this. If there is sample
- >code which I have missed, pointing me there would help.
- >
- >Thanks!
- >Chris Colapietro
-
-
- ........................................................................
- Henri Lamiraux lamiraux@apple.com
- Apple Computer, Inc. OpenDoc(tm) Development Framework
- ........................................................................
-
-
-